home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / pciio_dma.z / pciio_dma
Encoding:
Text File  |  2001-04-17  |  23.2 KB  |  463 lines

  1.  
  2.  
  3.  
  4. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      pciio_dma: pciio_dmatrans_addr, pciio_dmatrans_list, pciio_dmamap_alloc,
  10.      pciio_dmamap_addr, pciio_dmamap_list, pciio_dmamap_done,
  11.      pciio_dmamap_free, pciio_dma_addr, pciio_dmamap_drain,
  12.      pciio_dmaaddr_drain, pciio_dmalist_drain - manage DMA on PCI bus
  13.  
  14. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////PPPPCCCCIIII////ppppcccciiiiiiiioooo....hhhh>>>>
  16.  
  17.      iiiiooooppppaaaaddddddddrrrr____tttt
  18.      ppppcccciiiiiiiioooo____ddddmmmmaaaattttrrrraaaannnnssss____aaaaddddddddrrrr((((
  19.           vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _v_h_d_l,,,,
  20.           ddddeeeevvvviiiicccceeee____ddddeeeesssscccc____tttt _d_e_s_c,,,,
  21.           iiiiooooppppaaaaddddddddrrrr____tttt _a_d_d_r,,,,
  22.           ssssiiiizzzzeeee____tttt _s_i_z_e,,,,
  23.           uuuunnnnssssiiiiggggnnnneeeedddd _f_l_a_g_s))))
  24.  
  25.      aaaalllleeeennnnlllliiiisssstttt____tttt
  26.      ppppcccciiiiiiiioooo____ddddmmmmaaaattttrrrraaaannnnssss____lllliiiisssstttt((((
  27.           vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _v_h_d_l,,,,
  28.           ddddeeeevvvviiiicccceeee____ddddeeeesssscccc____tttt _d_e_s_c,,,,
  29.           aaaalllleeeennnnlllliiiisssstttt____tttt _l_i_s_t,,,,
  30.           uuuunnnnssssiiiiggggnnnneeeedddd _f_l_a_g_s))))
  31.  
  32.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt
  33.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____aaaalllllllloooocccc((((
  34.           vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _v_h_d_l,,,,
  35.           ddddeeeevvvviiiicccceeee____ddddeeeesssscccc____tttt _d_e_s_c,,,,
  36.           ssssiiiizzzzeeee____tttt _m_a_x,,,,
  37.           uuuunnnnssssiiiiggggnnnneeeedddd _f_l_a_g_s))))
  38.  
  39.      iiiiooooppppaaaaddddddddrrrr____tttt
  40.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____aaaaddddddddrrrr((((
  41.           ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt _m_a_p,,,,
  42.           iiiiooooppppaaaaddddddddrrrr____tttt _a_d_d_r,,,,
  43.           ssssiiiizzzzeeee____tttt _s_i_z_e))));;;;
  44.  
  45.      aaaalllleeeennnnlllliiiisssstttt____tttt
  46.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____lllliiiisssstttt((((
  47.           ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt _m_a_p,,,,
  48.           aaaalllleeeennnnlllliiiisssstttt____tttt _l_i_s_t,,,,
  49.           uuuunnnnssssiiiiggggnnnneeeedddd _f_l_a_g_s))));;;;
  50.  
  51.      vvvvooooiiiidddd
  52.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____ddddoooonnnneeee((((ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt _m_a_p))))
  53.  
  54.      vvvvooooiiiidddd
  55.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____ffffrrrreeeeeeee((((ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt _m_a_p))))
  56.  
  57.      iiiiooooppppaaaaddddddddrrrr____tttt
  58.      ppppcccciiiiiiiioooo____ddddmmmmaaaa____aaaaddddddddrrrr((((
  59.           vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _v_h_d_l,,,,
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  71.  
  72.  
  73.  
  74.          ddddeeeevvvviiiicccceeee____ddddeeeesssscccc____tttt _d_e_s_c,,,,
  75.           iiiiooooppppaaaaddddddddrrrr____tttt _a_d_d_r,,,,
  76.           ssssiiiizzzzeeee____tttt _s_i_z_e,,,,
  77.           ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt ****_m_a_p_p,,,,
  78.           uuuunnnnssssiiiiggggnnnneeeedddd _f_l_a_g_s))))
  79.  
  80.      vvvvooooiiiidddd
  81.      ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____ddddrrrraaaaiiiinnnn((((
  82.           ppppcccciiiiiiiioooo____ddddmmmmaaaammmmaaaapppp____tttt ****_m_a_p))))
  83.  
  84.      vvvvooooiiiidddd
  85.      ppppcccciiiiiiiioooo____ddddmmmmaaaaaaaaddddddddrrrr____ddddrrrraaaaiiiinnnn((((
  86.           vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _v_h_d_l,,,,
  87.           ppppaaaaddddddddrrrr____tttt _a_d_d_r,,,,
  88.           ssssiiiizzzzeeee____tttt _b_y_t_e_s))))
  89.  
  90.      vvvvooooiiiidddd
  91.      ppppcccciiiiiiiioooo____ddddmmmmaaaalllliiiisssstttt____ddddrrrraaaaiiiinnnn((((
  92.           vvvveeeerrrrtttteeeexxxx____hhhhddddllll____tttt _v_h_d_l,,,,
  93.           aaaalllleeeennnnlllliiiisssstttt____tttt ****_l_i_s_t))))
  94.  
  95.    AAAArrrrgggguuuummmmeeeennnnttttssss
  96.      _a_d_d_r The DMA buffer address in system physical address space.
  97.  
  98.      _d_e_s_c A device descriptor, usually zero.
  99.  
  100.      _f_l_a_g_s
  101.           Attributes of the mapping.
  102.  
  103.      _l_i_s_t An address/length list as prepared by one of the alenlist
  104.           construction functions (see _a_l_e_n_l_i_s_t(D4)).
  105.  
  106.      _m_a_p  A dma map as returned by _p_c_i_i_o__d_m_a_m_a_p__a_l_l_o_c().
  107.  
  108.      _m_a_p_p A place to return a map allocated as a side effect of other work;
  109.           must be initialized to zero, or to a map that should be used instead
  110.           of allocating one.
  111.  
  112.      _m_a_x  The maximum range of addresses this map will cover at any one time.
  113.  
  114.      _s_i_z_e The size of the mapped buffer in bytes.
  115.  
  116.      _v_h_d_l    The device connection point as passed to the _a_t_t_a_c_h() entry
  117.              point.
  118.  
  119. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  120.      When a device driver wishes to use Direct Memory Access (DMA) to
  121.      communicate with a device, the system needs to have a chance to set up
  122.      any appropriate mapping registers.  The work to be done varies with the
  123.      available hardware and with the version of IRIX.  The functions described
  124.      here provide an abstract interface to the creation of DMA mapping objects
  125.      that is consistent across most hardware.  These functions always do the
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  137.  
  138.  
  139.  
  140.      least possible work given the available hardware.
  141.  
  142.      There are two different models for setting up a DMA map, one simple but
  143.      fallible and the other more general.  In both models, the final goal is
  144.      to retrieve an address in PCI bus address space that can be used by a PCI
  145.      device to write into, or read from, system physical memory.
  146.  
  147.    SSSSiiiimmmmpppplllleeee MMMMooooddddeeeellll
  148.      The simple model provides permanent mappings through fixed mapping
  149.      resources that may or may not exist in a given system at a given time.
  150.      _p_c_i_i_o__d_m_a_t_r_a_n_s__a_d_d_r() is the one-stop shopping place for using system
  151.      fixed shareable mapping resources to construct a DMA address.  This is
  152.      not always possible.  When it is not, the function returns NULL.
  153.  
  154.      _p_c_i_i_o__d_m_a_t_r_a_n_s__l_i_s_t() is similar, but operates on a list of blocks of
  155.      memory and returns a list of blocks in PCI address space.
  156.  
  157.      When they work, these functions allow the driver to set up DMA with the
  158.      fewest complications.  Typically the functions always succeed in some
  159.      platforms (those having simple hardware mappings of PCI to memory), and
  160.      always fail in other platforms (where multiple layers of hardware
  161.      mappings must be configured dynamically).  However, drivers that use them
  162.      should be coded as if the functions could succeed or fail alternately in
  163.      the same system (which they could).
  164.  
  165.    GGGGeeeennnneeeerrrraaaallll MMMMooooddddeeeellll
  166.      It is not always possible to establish DMA mappings using common shared
  167.      system resources, so the concept of a DMA channel that preallocates
  168.      scarce mapping resources is provided.
  169.  
  170.      Such a channel is allocated using _p_c_i_i_o__d_m_a_m_a_p__a_l_l_o_c(), which is given
  171.      the maximum size to be mapped.  _p_c_i_i_o__d_m_a_m_a_p__a_d_d_r() or
  172.      _p_c_i_i_o__d_m_a_m_a_p__l_i_s_t() is then applied to the map to actually establish the
  173.      proper mappings for a DMA target.  Given the base address and block size
  174.      of the buffer for DMA (or a list of buffers), the functions hand back the
  175.      base PCI address to use for accessing that buffer (or a list of PCI
  176.      addresses).
  177.  
  178.      _p_c_i_i_o__d_m_a_m_a_p__d_r_a_i_n(), _p_c_i_i_o__d_m_a_a_d_d_r__d_r_a_i_n() or _p_c_i_i_o__d_m_a_l_i_s_t__d_r_a_i_n() are
  179.      used (depending on how the mapping was created) after a device reports it
  180.      has completed DMA, to ensure that all data along the DMA path has in fact
  181.      reached its destination.
  182.  
  183.      When all DMA to a given buffer (or list) is complete, _p_c_i_i_o__d_m_a_m_a_p__d_o_n_e()
  184.      should be called to idle any mapping hardware (and possibly flush out any
  185.      pipes or buffers along the path that might do unexpected things when
  186.      mapping registers are modified).  Later, _p_c_i_i_o__d_m_a_m_a_p__a_d_d_r() or
  187.      _p_c_i_i_o__d_m_a_m_a_p__l_i_s_t() can again be called, specifying the same or another
  188.      buffer area.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  203.  
  204.  
  205.  
  206.      When a driver is completely finished with a DMA channel -- because the
  207.      channel is used only for initialization of the device, because the
  208.      driver's _c_l_o_s_e() entry point is called so it is known that the device
  209.      will be idle for some time, or because the device or the driver is being
  210.      shut down -- the DMA channel resources should be released using
  211.      _p_c_i_i_o__d_m_a_m_a_p__f_r_e_e().
  212.  
  213.      _p_c_i_i_o__d_m_a__a_d_d_r() combines _p_c_i_i_o__d_m_a_t_r_a_n_s__a_d_d_r() and the
  214.      _p_c_i_i_o__d_m_a_m_a_p__a_l_l_o_c() / _p_c_i_i_o__d_m_a_m_a_p__a_d_d_r() facilities; it attempts to do
  215.      the direct translation, and if that fails, allocates a dmamap and
  216.      attempts to map through it.  The _m_a_p_p parameter should point to a
  217.      pciio_dmamap_t which has been either set to NULL, or set to a map that
  218.      should be used if one is needed.  On return, the value will be cleared if
  219.      the direct translation worked, or set to the map that was used.
  220.  
  221.    DDDDMMMMAAAA AAAAttttttttrrrriiiibbbbuuuutttteeee FFFFllllaaaaggggssss
  222.      The following attributes are specified in the _f_l_a_g_s argument:
  223.  
  224.      PCIIO_FIXED specifies that all DMA translations are done using fixed
  225.                  shared resources.  The results of those translations remain
  226.                  valid permanently, even if the map resource is subsequently
  227.                  used to obtain additional mappings.  Fixed shared resources
  228.                  are not always available.
  229.  
  230.      PCIIO_NOSLEEP
  231.                  specifies that any resources that are needed from the system
  232.                  are allocated without sleeping.  If any resource allocation
  233.                  would require the infrastructure to sleep, the service call
  234.                  returns a failure code.
  235.  
  236.      PCIIO_INPLACE
  237.                  on a list operation requests that the input list be modified
  238.                  in place.  When this flag is not specified, a new list is
  239.                  allocated for the translated addresses.  Allocating a new
  240.                  list preserves the contents of the input list.  However, it
  241.                  can take longer, may require sleeping, and may fail
  242.                  (especially if PCIIO_NOSLEEP is specified).
  243.  
  244.      PCIIO_DMA_CMD
  245.                  specifies that the DMA channel will be used for command-type
  246.                  transactions.  The channel is set up to optimize short
  247.                  transactions with frequent changes of direction.  Unless a
  248.                  more specific request is made using one of the other flags,
  249.                  any prefetch and write-gatherer hardware in the path is
  250.                  disabled.
  251.  
  252.      PCIIO_DMA_DATA
  253.                  specifies that the DMA channel will be used for data-type
  254.                  transactions.  The channel is set up to optimize longer
  255.                  transfers.  Unless a more specific request is made using one
  256.                  of the other flags, any prefetch and write-gatherer hardware
  257.                  in the path may be enabled.
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  269.  
  270.  
  271.  
  272.      PCIIO_DMA_A64
  273.                  indicates that the device is capable of using 64-bit PCI
  274.                  addresses for DMA.  If this flag is not specified, only DMA
  275.                  addresses in the low 4GB of PCI address space can be
  276.                  generated.  On some systems, 32-bit PCI addresses are a
  277.                  limited resource.  The map request fails if a 32-bit region
  278.                  cannot be allocated.
  279.  
  280.      PCIIO_WRITE_GATHER
  281.                  indicates that the device driver believes turning on write-
  282.                  gather hardware for this DMA channel is a good thing.  The
  283.                  flag overrides the write-gather choice from PCIIO_DMA_CMD.
  284.  
  285.      PCIIO_NOWRITE_GATHER
  286.                  indicates that the device driver believes turning on write-
  287.                  gather hardware for this DMA channel is a bad thing.  The
  288.                  flag overrides the write gather choice from PCIIO_DMA_DATA.
  289.  
  290.      PCIIO_PREFETCH
  291.                  indicates that the device driver believes turning on
  292.                  prefetching hardware for this DMA channel is a good thing.
  293.                  The flag overrides the prefetch choice from PCIIO_DMA_CMD.
  294.  
  295.      PCIIO_NOPREFETCH
  296.                  indicates that the device driver believes turning on
  297.                  prefetching hardware for this DMA channel is a bad thing.
  298.                  The flag overrides the prefetch settings from PCIIO_DMA_DATA.
  299.  
  300.      PCIIO_BYTE_STREAM
  301.                  demands that any byte-swapping hardware along this DMA path
  302.                  be organized so that an ordered stream of bytes from the
  303.                  device are deposited in order in system memory.  This is the
  304.                  typical setting for data streams.  If this endianness cannot
  305.                  be supplied, then the service call fails.
  306.  
  307.      PCIIO_WORD_VALUES
  308.                  demands that any byte-swapping hardware along this DMA path
  309.                  be initialized so that 32-bit quantities on PCI-bus 32-bit
  310.                  boundaries maintain their binary values.  This is the typical
  311.                  setting for command-type transactions because command words
  312.                  exchanged with a little-endian PCI device retain their binary
  313.                  values.  If this endianness cannot be supplied, then the
  314.                  service call fails.
  315.  
  316.      When PCIIO_BYTE_STREAM is used, the bytes of multibyte values embedded in
  317.      input data are found at their original offsets.  Multibyte values from
  318.      little-endian devices may require programmed swapping before use.
  319.  
  320.      When PCIIO_WORD_VALUES is used,
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  335.  
  336.  
  337.  
  338.      +o   Single bytes in input data are found at the offset the device places
  339.          them, exclusive-or with 3.
  340.  
  341.      +o   16-bit quantities in input data are found at the offset used by the
  342.          device, exclusive-or with 2, and do not need to be byteswapped.
  343.  
  344.      +o   32-bit values are found at the expected offset, and do not need to be
  345.          byteswapped.
  346.  
  347.      +o   64-bit values are found at the expected offset, and their 32-bit
  348.          halves need to be swapped before use.
  349.  
  350. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  351.      Here is one way that a driver might make use of dmamap and dmatrans
  352.      calls.
  353.  
  354.           pcifoo_attach(vertex_hdl_t vhdl)
  355.           {
  356.                pciio_dmamap_t command_map;
  357.                iopaddr_t command_dma;
  358.                struct pcifoo_regs  *reg_pio;
  359.                struct pcifoo_ring  *command_ring;
  360.                ...
  361.                /*
  362.                 * This driver has decided to use a dmamap
  363.                 * to get to its command rings, which contain
  364.                 * things like DMA addresses and counts; we
  365.                 * set PCIIO_WORD_VALUES so we don't have to
  366.                 * byteswap the 32-bit values.
  367.                 *
  368.                 * We still have to swap the upper and lower
  369.                 * halves of the 64-bit values.
  370.                 */
  371.                /* allocate the channel
  372.                 */
  373.                command_map = pciio_dmamap_alloc(
  374.                     vhdl, 0,
  375.                     RINGBYTES,
  376.                     PCIIO_DMA_CMD |
  377.                     PCIIO_WORD_VALUES);
  378.                command_dma = pciio_dmamap_addr(
  379.                     command_map,
  380.                     kvtophys(command_ring),
  381.                     RINGBYTES);
  382.                /* tell the device where it can find
  383.                 * it's command rings.
  384.                 */
  385.                reg_pio->command_dma = command_dma;
  386.                ...
  387.           }
  388.           {
  389.                caddr_t   data_buffer;
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))                                                    ppppcccciiiiiiiioooo____ddddmmmmaaaa((((DDDD3333))))
  401.  
  402.  
  403.  
  404.               size_t     data_size;
  405.                ...
  406.                data_dma = pciio_dmatrans_addr(
  407.                     vhdl, 0,
  408.                     kvtophys(data_buffer), data_size,
  409.                     PCIIO_DMA_DATA|
  410.                     PCIIO_DMA_A64|
  411.                     PCIIO_BYTE_STREAM);
  412.                command_ring->data_dma_lo = data_dma & 0xFFFFFFFF;
  413.                command_ring->data_dma_hi = data_dma >> 32;
  414.                command_ring->data_dma_size = data_size;
  415.                command_ring->ready = 1;
  416.           }
  417.  
  418.  
  419. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  420.      alenlist(D3), pcibr_get_dmatrans_node(D3), pciio(D3), pciio_config(D3),
  421.      pciio_error(D3), pciio_get(D3), pciio_intr(D3), pciio_pio(D3).
  422.  
  423. NNNNOOOOTTTTEEEE
  424.      Do not point the _m_a_p_p parameter to the _p_c_i_i_o__d_m_a__a_d_d_r() function at your
  425.      only copy of a map pointer, since it will write a NULL through this
  426.      pointer when direct translations work.
  427.  
  428.      In IRIX 6.3, _p_c_i_i_o__d_m_a_t_r_a_n_s__l_i_s_t() is declared and implemented with two
  429.      arguments only, taking no _f_l_a_g_s argument.  When porting a driver from
  430.      IRIX 6.3, add a third argument of NULL (or other flag values as desired).
  431.  
  432. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  433.      _p_c_i_i_o__d_m_a_t_r_a_n_s__a_d_d_r() returns zero if shared (fixed) resources can not be
  434.      used to construct a valid PCI address that maps to the desired range of
  435.      physical addresses.
  436.  
  437.      _p_c_i_i_o__d_m_a_t_r_a_n_s__l_i_s_t() returns a null pointer if any of the requested
  438.      physical address blocks can not be reached using shared fixed resources,
  439.      or if unable to allocate a return list.
  440.  
  441.      _p_c_i_i_o__d_m_a_m_a_p__a_l_l_o_c() returns a null pointer if resources can not be
  442.      allocated to establish DMA mappings of the requested size, or if the
  443.      parameters are inconsistent.
  444.  
  445.      _p_c_i_i_o__d_m_a_m_a_p__a_d_d_r() returns zero if the specified target address can not
  446.      be mapped using the specified DMA channel.  This would usually be due to
  447.      specifying a target block that is outside the previously specified target
  448.      area or is larger than the previously specified maximum mapping size.  It
  449.      may also return a null pointer if the DMA channel is currently in use and
  450.      has not been marked idle by a call to _p_c_i_i_o__d_m_a_m_a_p__d_o_n_e().
  451.  
  452.      _p_c_i_i_o__d_m_a_m_a_p__l_i_s_t() can return a null pointer for all the reasons
  453.      mentioned above, or if it is unable to allocate the return list.
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.